﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PokerClient.Connection.CommandHandlers;

namespace PokerClient.Commands.CommandFactories
{
	class winnerHandler : absHandler
	{
		private VisualDisp.Table table;
		private Client myClient;
		String message;
		public winnerHandler(VisualDisp.Table table, Client myClient)
		{
			// TODO: Complete member initialization
			this.table = table;
			this.myClient = myClient;
		}

		public override void assignCommand(string commands)
		{
			this.commands = commands.Split(' ', ',');
			this.message = commands;
		}

		public override string work()
		{
			//String t = "Winner:";
			/*for (int i = 1; i < commands.Length; i++)
			{
				int j = commands[i].IndexOf('#');
				t+= String.Format("{0} with {1},",commands[i].Substring(0,j),commands[i].Substring(j+1,commands[i].Length));
			}
			 */
			return (message);
		}

		public override void analyze()
		{
			this.table.announceWinner(message);
		}
	}
}
